package com.wymobilearchitecture

import com.example.w_library.log.base.WLogConfig
import com.example.w_library.log.base.WLogConfig.JsonParser
import com.example.w_library.log.base.WLogManager
import com.example.w_library.log.priter.console.WLogConsolePrinter
import com.example.w_library.utils.ActivityManager
import com.example.w_library.utils.ActivityManager.Companion.instances
import com.google.gson.Gson
import com.wy.common.base.BaseApplication

class MyApplication : BaseApplication(){

    override fun onCreate() {
        super.onCreate()

        WLogManager.init(object : WLogConfig(){

            override fun injectJsonParser(): JsonParser {
                return JsonParser { src -> Gson().toJson(src) }
            }

            override fun getGlobalTag(): String {
                return "app_log"
            }

            override fun enable(): Boolean {
                return true
            }
        }, WLogConsolePrinter())

        ActivityManager.instances.init(this)

        //activity 管理工具
        instances.init(this)
    }
}